import { Component,Renderer2 } from '@angular/core';

/**
 * 折叠组件中的面板子组件
 * 包含icon maintitle subheading
 */
@Component({
  selector: 'nova-expansion-panel',
  templateUrl: './expansion-panel.component.html',
  styleUrls: ['./expansion-panel.component.scss']
})
export class ExpansionPanelComponent {
  /**
   * 面板构造函数
   * @param rd2 注入渲染工具，用于改变DOM样式
   */
  constructor(private rd2: Renderer2) {}
  /**
   * 切换面板展开效果
   * @param dom01 
   * @param dom02 
   * @param dom03 
   */
  change(dom01: any, dom02: any, dom03: any) {
    this.rd2.setStyle(dom02, 'display', 'none')
    this.rd2.setStyle(dom03, 'display', 'none')
    if (dom01.style.display == 'block') {
      this.rd2.setStyle(dom01, 'display', 'none')
    } else {
      this.rd2.setStyle(dom01, 'display', 'block')
    }
  }
}
